package com.yunxiao.cloud.common.exception;

/**
 * @description: BusinessRuntimeException
 * @date: 2019/12/16 14:30
 * @author: yunxiao
 * @version: 1.0
 */
public class BusinessRuntimeException extends RuntimeException {
    private static final long serialVersionUID = -5364184862490085589L;
    private final String code;
    private final String reason;

    public BusinessRuntimeException(String message, Throwable cause, String code, String reason) {
        super(message, cause);
        this.code = code;
        this.reason = reason;
    }

    public BusinessRuntimeException(String code, String reason) {
        super(reason);
        this.code = code;
        this.reason = reason;
    }

    public BusinessRuntimeException(String code, String reason, Throwable throwable) {
        super(reason, throwable);
        this.code = code;
        this.reason = reason;
    }

    public String getCode() {
        return code;
    }

    public String getReason() {
        return reason;
    }
}
